package com.yu.autobean01;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.annotation.ApplicationScope;

@ComponentScan
@Configuration
@ApplicationScope
public class Test {

	@Autowired
	private Gong gong;
	
	private void test() {
		CompactDisc randomBeatlesCD = gong.randomBeatlesCD();
		randomBeatlesCD.play();
	}
	
	public static void main(String[] args) throws InterruptedException {
		Test test=new Test();
		for (int i = 0; i < 10; i++) {
			Thread.currentThread().sleep(1000);
			test.test();
		}
	}
			
}
